$OpenBSD: patch-reminder_c,v 1.1.1.1 2003/11/03 20:34:18 sturm Exp $
--- reminder.c.orig	2002-12-04 06:29:09.000000000 +0100
+++ reminder.c	2003-11-02 16:42:30.000000000 +0100
@@ -87,7 +87,7 @@ static struct reminder_config {
 
 struct event_stored {
   gchar *name;
-  guint id;
+  gulong id;
   gint days;
   gint occurs;
   time_t start;
@@ -333,7 +333,7 @@ reminder_load_stored()
   //    strcpy( current->name, buffer );
       current->name = g_strdup(buffer);
 
-      if( fscanf( fp, "%u %d %d %ld %ld %ld\n", &current->id, &current->days,
+      if( fscanf( fp, "%lu %d %d %d %d %d\n", &current->id, &current->days,
           &current->occurs, &current->start, &current->end,
           &current->last_displayed ) != 6 )
 	{
@@ -431,7 +431,7 @@ reminder_save_stored()
   current = head_stored;
   while( current )
     {
-      fprintf( fp, "%s\n%u %d %d %ld %ld %ld\n", current->name, current->id, current->days,
+      fprintf( fp, "%s\n%lu %d %d %d %d %d\n", current->name, current->id, current->days,
 	       current->occurs, current->start, current->end, current->last_displayed );
 
       current = current->next;
@@ -529,7 +529,7 @@ reminder_remove_event_stored( struct eve
 }
 
 static struct event_stored *
-reminder_find_event_stored( struct event_stored *head_list, guint id )
+reminder_find_event_stored( struct event_stored *head_list, gulong id )
 {
   struct event_stored *current;
 
@@ -1003,8 +1003,8 @@ reminder_build_today( gboolean rebuild )
 static void
 cb_set_days( GtkWidget *window, gpointer data )
 {
-  gint weekdays = (gint) data & 1;
-  gint weekends = (gint) data & 2;
+  gint weekdays = (GPOINTER_TO_INT (data)) & 1;
+  gint weekends = (GPOINTER_TO_INT (data)) & 2;
 
   gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( check_sun ), weekends );
   gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( check_sat ), weekends );
@@ -1383,12 +1383,12 @@ static void
 cb_remove( GtkWidget *window, gpointer data )
 {
   struct id_list *current;
-  guint id;
+  gulong id;
 
   if( list_main_row_selected == -1 )
     return;
 
-  id = (guint) gtk_clist_get_row_data( GTK_CLIST( list_main ), list_main_row_selected );
+  id = (gulong) gtk_clist_get_row_data( GTK_CLIST( list_main ), list_main_row_selected );
 
   /* Try to remove event from temp list. If not, add to to-be-deleted list */
   if( !reminder_remove_event_stored( &head_temp, id ) )
@@ -1661,13 +1661,13 @@ cb_sort_days( GtkCList *clist, gconstpoi
 
   struct event_stored *es1, *es2;
 
-  es1 = reminder_find_event_stored( head_stored, (guint) row1->data );
+  es1 = reminder_find_event_stored( head_stored, (gulong) row1->data );
   if( !es1 )
-    es1 = reminder_find_event_stored( head_temp, (guint) row1->data );
+    es1 = reminder_find_event_stored( head_temp, (gulong) row1->data );
 
-  es2 = reminder_find_event_stored( head_stored, (guint) row2->data );
+  es2 = reminder_find_event_stored( head_stored, (gulong) row2->data );
   if( !es2 )
-    es2 = reminder_find_event_stored( head_temp, (guint) row2->data );
+    es2 = reminder_find_event_stored( head_temp, (gulong) row2->data );
 
   if( es1 && es2 )
     {
@@ -1692,13 +1692,13 @@ cb_sort_time( GtkCList *clist, gconstpoi
 
   struct event_stored *es1, *es2;
 
-  es1 = reminder_find_event_stored( head_stored, (guint) row1->data );
+  es1 = reminder_find_event_stored( head_stored, (gulong) row1->data );
   if( !es1 )
-    es1 = reminder_find_event_stored( head_temp, (guint) row1->data );
+    es1 = reminder_find_event_stored( head_temp, (gulong) row1->data );
 
-  es2 = reminder_find_event_stored( head_stored, (guint) row2->data );
+  es2 = reminder_find_event_stored( head_stored, (gulong) row2->data );
   if( !es2 )
-    es2 = reminder_find_event_stored( head_temp, (guint) row2->data );
+    es2 = reminder_find_event_stored( head_temp, (gulong) row2->data );
 
   if( es1 && es2 )
     return( ( ( es1->start - TIMEZONE_DIFF ) % SECS_PER_DAY ) -
@@ -1715,13 +1715,13 @@ cb_sort_start( GtkCList *clist, gconstpo
 
   struct event_stored *es1, *es2;
 
-  es1 = reminder_find_event_stored( head_stored, (guint) row1->data );
+  es1 = reminder_find_event_stored( head_stored, (gulong) row1->data );
   if( !es1 )
-    es1 = reminder_find_event_stored( head_temp, (guint) row1->data );
+    es1 = reminder_find_event_stored( head_temp, (gulong) row1->data );
 
-  es2 = reminder_find_event_stored( head_stored, (guint) row2->data );
+  es2 = reminder_find_event_stored( head_stored, (gulong) row2->data );
   if( !es2 )
-    es2 = reminder_find_event_stored( head_temp, (guint) row2->data );
+    es2 = reminder_find_event_stored( head_temp, (gulong) row2->data );
 
   if( es1 && es2 )
     return es1->start - es2->start;
@@ -1737,13 +1737,13 @@ cb_sort_end( GtkCList *clist, gconstpoin
 
   struct event_stored *es1, *es2;
 
-  es1 = reminder_find_event_stored( head_stored, (guint) row1->data );
+  es1 = reminder_find_event_stored( head_stored, (gulong) row1->data );
   if( !es1 )
-    es1 = reminder_find_event_stored( head_temp, (guint) row1->data );
+    es1 = reminder_find_event_stored( head_temp, (gulong) row1->data );
 
-  es2 = reminder_find_event_stored( head_stored, (guint) row2->data );
+  es2 = reminder_find_event_stored( head_stored, (gulong) row2->data );
   if( !es2 )
-    es2 = reminder_find_event_stored( head_temp, (guint) row2->data );
+    es2 = reminder_find_event_stored( head_temp, (gulong) row2->data );
 
   if( es1 && es2 )
     return es1->end - es2->end;
@@ -2884,7 +2884,7 @@ reminder_text_button_enable( void )
 static void
 reminder_window_never( GtkWidget *window, gpointer data )
 {
-  guint id = (guint) data;
+  gulong id = (gulong) data;
 
   /* delete event from today */
   num_active--;
@@ -2914,7 +2914,7 @@ reminder_window_never( GtkWidget *window
 static void
 reminder_window_later( GtkWidget *window, gpointer data )
 {
-  guint id = (guint) data;
+  gulong id = (gulong) data;
   struct event_stored *new, *old;
 
   /* delete event from today */
@@ -2991,7 +2991,7 @@ reminder_window_later( GtkWidget *window
 static void
 reminder_window_dismiss( GtkWidget *window, gpointer data )
 {
-  guint id = (guint) data;
+  gulong id = (gulong) data;
 
   /* delete event from today */
   num_active--;
